package com.TwinBlade.PicturePassword;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.RectF;
import android.graphics.SweepGradient;
import android.view.MotionEvent;
import android.view.View;
import android.widget.EditText;

class i extends View
{
  private Paint b;
  private Paint c;
  private final int[] d;
  private j e;
  private boolean f;
  private boolean g;

  i(e parame, Context paramContext, j paramj, int paramInt)
  {
    super(paramContext);
    this.e = paramj;
    this.d = new int[] { -65536, -65281, -16776961, -16711681, -16711936, -256, -1, -8355712, -16777216, -65536 };
    SweepGradient localSweepGradient = new SweepGradient(0.0F, 0.0F, this.d, null);
    this.b = new Paint(1);
    this.b.setShader(localSweepGradient);
    this.b.setStyle(Paint.Style.STROKE);
    this.b.setStrokeWidth(32.0F);
    this.c = new Paint(1);
    this.c.setColor(paramInt);
    this.c.setStrokeWidth(5.0F);
  }

  private int a(int paramInt1, int paramInt2, float paramFloat)
  {
    return paramInt1 + Math.round(paramFloat * (paramInt2 - paramInt1));
  }

  private int a(int[] paramArrayOfInt, float paramFloat)
  {
    if (paramFloat <= 0.0F)
      return paramArrayOfInt[0];
    if (paramFloat >= 1.0F)
      return paramArrayOfInt[(-1 + paramArrayOfInt.length)];
    float f1 = paramFloat * (-1 + paramArrayOfInt.length);
    int i = (int)f1;
    float f2 = f1 - i;
    int j = paramArrayOfInt[i];
    int k = paramArrayOfInt[(i + 1)];
    return Color.argb(a(Color.alpha(j), Color.alpha(k), f2), a(Color.red(j), Color.red(k), f2), a(Color.green(j), Color.green(k), f2), a(Color.blue(j), Color.blue(k), f2));
  }

  public void a(int paramInt)
  {
    this.c.setColor(paramInt);
    invalidate();
  }

  public void b(int paramInt)
  {
    int i = this.c.getColor();
    int j = Color.argb(paramInt, Color.red(i), Color.green(i), Color.blue(i));
    this.c.setColor(j);
    e.d(this.a).setText(e.a(this.a, j));
    invalidate();
  }

  @SuppressLint({"DrawAllocation"})
  protected void onDraw(Canvas paramCanvas)
  {
    float f1 = 100.0F - 0.5F * this.b.getStrokeWidth();
    paramCanvas.translate(100.0F, 100.0F);
    paramCanvas.drawOval(new RectF(-f1, -f1, f1, f1), this.b);
    paramCanvas.drawCircle(0.0F, 0.0F, 32.0F, this.c);
    int i;
    if (this.f)
    {
      i = this.c.getColor();
      this.c.setStyle(Paint.Style.STROKE);
      if (!this.g)
        break label136;
      this.c.setAlpha(255);
    }
    while (true)
    {
      paramCanvas.drawCircle(0.0F, 0.0F, 32.0F + this.c.getStrokeWidth(), this.c);
      this.c.setStyle(Paint.Style.FILL);
      this.c.setColor(i);
      return;
      label136: this.c.setAlpha(128);
    }
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    setMeasuredDimension(200, 200);
  }

  public boolean onTouchEvent(MotionEvent paramMotionEvent)
  {
    float f1 = paramMotionEvent.getX() - 100.0F;
    float f2 = paramMotionEvent.getY() - 100.0F;
    boolean bool;
    if (Math.sqrt(f1 * f1 + f2 * f2) <= 32.0D)
    {
      bool = true;
      switch (paramMotionEvent.getAction())
      {
      default:
      case 0:
      case 2:
      case 1:
      }
    }
    label126: 
    do
    {
      do
      {
        return true;
        bool = false;
        break;
        this.f = bool;
        if (bool)
        {
          this.g = true;
          invalidate();
          return true;
        }
        if (!this.f)
          break label126;
      }
      while (this.g == bool);
      this.g = bool;
      invalidate();
      return true;
      float f3 = (float)Math.atan2(f2, f1) / 6.283185F;
      if (f3 < 0.0F)
        f3 += 1.0F;
      int i = a(this.d, f3);
      this.c.setColor(i);
      e.d(this.a).setText(e.a(this.a, i));
      this.e.b(i);
      invalidate();
      return true;
    }
    while (!this.f);
    if (bool)
      this.e.a(this.c.getColor());
    this.f = false;
    invalidate();
    return true;
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.TwinBlade.PicturePassword.i
 * JD-Core Version:    0.6.2
 */